import { baseUrl } from '@/config/env';

export const tableOption = {
  selection: true,
  rowKey: 'tableName',
  border: true,
  index: true,
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  addBtn: false,
  editBtn: false,
  delBtn: false,
  cancelBtn: false,
  saveBtn: false,
  reserveSelection: true,
  searchMenuSpan: 6,
  column: [{
    label: '表名称',
    prop: 'tableName',
    align: 'center'
  }, {
    label: '表注释',
    prop: 'tableComment',
    align: 'center'
  }, {
    type: 'datetime',
    valueFormat: 'timestamp',
    format: 'YYYY-MM-DD HH:mm',
    valueFormat: 'YYYY-MM-DD HH:mm:ss',
    label: '创建时间',
    prop: 'createTime',
    align: 'center'
  }]
}

/**
 * 表的列属性
 */
export const tableColumnOption = {
  rowKey: 'tableName',
  border: true,
  index: true,
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  menu: false,
  addBtn: false,
  searchMenuSpan: 6,
  column: [{
    label: '字段名',
    prop: 'columnName',
    align: 'center'
  }, {
    label: '注释',
    prop: 'comments',
    align: 'center',
    overHidden: true
  }, {
    label: '字段类型',
    prop: 'columnType',
    align: 'center'
  }, {
    label: 'JAVA类型',
    prop: 'javaType',
    align: 'center'
  }]
}

/**
 * 代码生成
 */
export const tableGenOption = {
  submitBtn: false,
  emptyBtn: false,
  column: [
    {
      label: '表名称',
      prop: 'tableName',
      disabled: true
    },
    {
      label: '包名',
      prop: 'packageName',
      placeholder: '可为空，加载系统默认配置'
    },
    {
      label: '模块',
      prop: 'moduleName',
      placeholder: '可为空，加载系统默认配置'
    },
    {
      label: '表前缀',
      prop: 'tablePrefix',
      placeholder: '可为空，加载系统默认配置'
    },
    {
      label: '作者',
      prop: 'author',
      placeholder: '可为空，加载系统默认配置'
    },
    {
      label: '注释',
      prop: 'comments',
      placeholder: '可为空，加载表备注'
    },
    {
      label: '前端风格',
      prop: 'style',
      type: 'radio',
      slot: true,
      border: true,
      span: 24,
      value:'0',
      dicUrl: baseUrl+'/sys/dict/type/gen_style_type',
    }
  ]
}

